package com.palmshop.online.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.palmshop.online.entity.PalmResult;
import com.palmshop.online.service.GoodsService;

/**
 * 商品信息相关的controller
 * @author quan
 *
 */
@Controller
@RequestMapping("/goods")
public class GoodsContorller {

	@Resource
	private GoodsService service;//service注入
	
	

	/**
	 * 根据商铺的标识查询出该店铺的商品分类信息
	 * @param shopUnique:商品唯一性标识
	 * @return json
	 */
	@RequestMapping("/findGoodsKind.do")
	@ResponseBody
	public PalmResult findGoodsKind(String shopUnique){
		
		return service.findGoodsKind(shopUnique);
	}
	
	/**
	 * 根据商品id查询商品的详情信息
	 * @param goodsId:商品id
	 * @return json
	 */
	@RequestMapping("/findGoodsById.do")
	@ResponseBody
	public PalmResult findGoodsById(Integer goodsId) {
		return service.findGoodsById(goodsId);
	}

	


}
